/**
 * 
 */
package com.example.demo.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.example.demo.entity.IUser;
import com.example.demo.entity.User;
import com.example.demo.service.UserService;

/**
 * @author CJunGod 1038804380@qq.com
 *
 */

@Controller
public class UserController {

	@Resource
	private UserService userService;
	
	@ResponseBody
	@GetMapping("/user")
	public User getUser(String userName) {
		userName = "admin";
		
		return userService.selectByUser(userName);
	}
	
	@ResponseBody
	@GetMapping("/iUser")
	public IUser getIUser(String userName) {
		userName = "one";
		
		return userService.findUser(userName);
	}
	
	@ResponseBody
	@GetMapping("/saveIUser")
	public boolean saveIUser(String userName,String password) {
		userName = "Threess";
		password ="12345678";
		return userService.saveIUser(userName, password);
	}
}
